@echo off
chcp 65001 > nul
title 获取硬件信息
setlocal enabledelayedexpansion

REM 获取 CPU 信息
for /f "tokens=2 delims==" %%a in ('wmic cpu get Name /value ^| findstr "="') do (
    set "cpuInfo=%%a"
)

REM 获取 GPU 信息
for /f "tokens=2 delims==" %%a in ('wmic path win32_videocontroller get Name /value ^| findstr "="') do (
    set "gpuInfo=%%a"
)

REM 获取内存信息
for /f "tokens=2" %%a in ('wmic ComputerSystem get TotalPhysicalMemory /value ^| findstr "="') do (
    set /a memoryGB=%%a/1073741824
)

REM 获取显示器尺寸信息
for /f "tokens=2 delims==" %%a in ('wmic desktopmonitor get ScreenHeight,ScreenWidth /value ^| findstr "="') do (
    set /a "monitorSize=%%a/2.54"
)

REM 输出结果
echo CPU: %cpuInfo%
echo GPU: %gpuInfo%
echo 内存: %memoryGB% GB
echo 显示器尺寸: %monitorSize% 英寸

pause
